package com.ruoyi.kindergarten.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.kindergarten.mapper.EnvironmentInfoMapper;
import com.ruoyi.kindergarten.domain.EnvironmentInfo;
import com.ruoyi.kindergarten.service.IEnvironmentInfoService;

/**
 * 环境信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-26
 */
@Service
public class EnvironmentInfoServiceImpl implements IEnvironmentInfoService 
{
    @Autowired
    private EnvironmentInfoMapper environmentInfoMapper;

    /**
     * 查询环境信息
     * 
     * @param id 环境信息主键
     * @return 环境信息
     */
    @Override
    public EnvironmentInfo selectEnvironmentInfoById(Long id)
    {
        return environmentInfoMapper.selectEnvironmentInfoById(id);
    }

    /**
     * 查询环境信息列表
     * 
     * @param environmentInfo 环境信息
     * @return 环境信息
     */
    @Override
    public List<EnvironmentInfo> selectEnvironmentInfoList(EnvironmentInfo environmentInfo)
    {
        return environmentInfoMapper.selectEnvironmentInfoList(environmentInfo);
    }

    /**
     * 新增环境信息
     * 
     * @param environmentInfo 环境信息
     * @return 结果
     */
    @Override
    public int insertEnvironmentInfo(EnvironmentInfo environmentInfo)
    {
        environmentInfo.setCreateTime(DateUtils.getNowDate());
        return environmentInfoMapper.insertEnvironmentInfo(environmentInfo);
    }

    /**
     * 修改环境信息
     * 
     * @param environmentInfo 环境信息
     * @return 结果
     */
    @Override
    public int updateEnvironmentInfo(EnvironmentInfo environmentInfo)
    {
        return environmentInfoMapper.updateEnvironmentInfo(environmentInfo);
    }

    /**
     * 批量删除环境信息
     * 
     * @param ids 需要删除的环境信息主键
     * @return 结果
     */
    @Override
    public int deleteEnvironmentInfoByIds(Long[] ids)
    {
        return environmentInfoMapper.deleteEnvironmentInfoByIds(ids);
    }

    /**
     * 删除环境信息信息
     * 
     * @param id 环境信息主键
     * @return 结果
     */
    @Override
    public int deleteEnvironmentInfoById(Long id)
    {
        return environmentInfoMapper.deleteEnvironmentInfoById(id);
    }
}
